feat(opencode): delete SessionEnd session_checkpoint write (03-R1/06-M1)#81
Merged
Merged
Conversation
…eckpoint write (03-R1/06-M1) The opencode plugin's parallel session_checkpoint `remember --force` write — the sibling of the Claude-plugin write deleted in #80. It fired on every stop/idle/compacted/deleted event + per-turn (every N positive touches) + before improve/propose/evolve + a manual akm_memory action, flooding the stash with below-every-gate write-only telemetry. Meta-review 03-R1/06-M1 retires it. Deleted (opencode/index.ts): `captureSessionMemory` (the session_checkpoint body-builder + `remember --force` write), `maybeCheckpointSessionMemory`, `ensureFreshProposalCheckpoint`, and their helpers (formatEvidenceSummary, formatPathBullet, countByValue, uniqueRecent, sessionHasPendingCheckpointEvidence, getHarnessStatePaths) + dead state (AKM_MEMORY_CHECKPOINT_EVERY, sessionFinalMemoryCaptured, sessionSuccessfulAssetTouchCount). Removed all call sites: stop/idle handlers, the per-turn positive-feedback checkpoint, the akm_memory `checkpoint` action (dropped from the enum too), and the pre-improve/ pre-propose/pre-evolve checkpoints. `akm index` on session-end survives — `maybeIndexSessionMemory` now runs decoupled from the deleted write. PRESERVED: the candidate → /akm-memory-promote pipeline (extractCandidatesFromText/appendCandidates), the SessionEnd `akm extract` path, and `rememberTextAsMemory` (kept — the akm-curator (akm_evolve) output write at line ~3545 still uses it; that is a deliberate curator artifact, not the session_checkpoint telemetry, and is out of 03-R1's scope). Tests: deleted 5 that asserted the checkpoint/stop write + migrated 1 to assert `akm index` still runs on stop with NO `remember` call. Gate: `bun test tests/` 314/0, `tsc --noEmit` clean, `tier2/runner.ts --baseline` exit 0. Net −542 LOC. (Done directly, in Opus — the opencode/gpt-5.4 agent stalled on an OpenCode Zen monthly usage-limit; small requests trickled through but the deletion task hung.) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018YjU1mGiShdDP4qFW7p4mv
… fable alias
Two fixes to the PreToolUse Agent-dispatch model-remap hook:
1. `preToolAgent()` returned `updatedInput: { model: resolved }`, which
REPLACES the entire Agent tool input with just the model — dropping
`prompt`, `subagent_type`, and every other param, so the dispatched Agent
call was malformed. Spread `...toolInput` so only `model` is overridden.
2. Add `fable` to `CC_VALID_MODEL_ALIASES` — Fable 5 (`claude-fable-5`) is a
real Claude Code model alias now, so it must pass through instead of being
remapped to `sonnet`.
Gate: tsc --noEmit 0 errors, bun test tests/ 314/0.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018YjU1mGiShdDP4qFW7p4mv
Owner
Author
|
Added a second, unrelated-but-necessary commit riding this branch: |
…eted with 03-R1) The prior commit deleted `captureSessionMemory`, which did TWO things: the session_checkpoint `remember --force` write (correctly retired by 03-R1/06-M1) AND the memory-candidate extraction that feeds the owner-gated candidate -> /akm-memory-promote pipeline (a KEEP reference rung). The second went out with the first, so no candidates were harvested on session end. This passed `bun test tests/` locally only because three candidate tests read a persistent on-disk candidate log seeded by earlier runs under the same stable session IDs; CI's clean checkout had no such state and the tests failed (`expect(candidates.length).toBeGreaterThan(0)`). Fix: add `maybeExtractSessionCandidates(sessionID, reason)` — harvests explicit "remember ..." intents from the session buffer into the candidate log with NO stash write, wired into `stop` (the reliable terminal flush) and `session.deleted` (salvage before the buffer is discarded). Deleting the buffer after extraction is the de-dup that the removed `sessionFinalMemoryCaptured` Set used to provide. Candidate text is now sourced from memory-intent notes only (higher signal than the old full-checkpoint-body scan), which suits 03-R1's noise-reduction intent. Not wired into the recurring `session.idle`/`session.compacted` events — those fire per-turn and a per-turn buffer flush is exactly the churn 03-R1 retires; `session.idle` already runs the `akm extract` backstop. Gate (clean isolated HOME/XDG, CI-equivalent): tsc 0 errors, `bun test tests/` 314/0. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018YjU1mGiShdDP4qFW7p4mv
Contributor
Eval diff
Metric deltas
Plugin surfaceNo surface changes. No regressions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Opencode-plugin half of the minting-shutdown batch — the sibling of the Claude-plugin write deleted in #80.
What
The opencode plugin fired a parallel
session_checkpointremember --forcewrite on every stop/idle/compacted/deleted event, per-turn (every N positive touches), before improve/propose/evolve, and via a manualakm_memory checkpointaction. All of it was below-every-gate write-only telemetry — meta-review 03 measured the stash at 98.2% write-only, and 06-M1 identified this checkpoint write as the primary minting source. 03-R1/06-M1 retires it.Deleted (
opencode/index.ts)captureSessionMemory(the checkpoint body-builder +remember --forcewrite)maybeCheckpointSessionMemory,ensureFreshProposalCheckpointformatEvidenceSummary,formatPathBullet,countByValue,uniqueRecent,sessionHasPendingCheckpointEvidence,getHarnessStatePathsAKM_MEMORY_CHECKPOINT_EVERY,sessionFinalMemoryCaptured,sessionSuccessfulAssetTouchCountakm_memorycheckpointaction (dropped from the enum), pre-improve/pre-propose/pre-evolve checkpointsPreserved
akm indexon session-end —maybeIndexSessionMemorynow runs decoupled from the deleted write/akm-memory-promotepipeline (extractCandidatesFromText/appendCandidates)akm extractpathrememberTextAsMemory— still used by the akm-curator (akm_evolve) output write (~line 3545); that is a deliberate curator artifact, not the session_checkpoint telemetry, and is out of 03-R1 scopeTests
Deleted 5 that asserted the checkpoint/stop write; migrated 1 to assert
akm indexstill runs on stop with noremembercall.Gate
tsc --noEmit— 0 errorsbun test tests/— 314 pass / 0 failtier2/runner.ts --baseline— exit 0Net −542 LOC.
🤖 Generated with Claude Code